Skip to content

fix: deprecate --*.disabled CLI flags, wire up --mcp.disabled#3482

Open
souvikghosh04 wants to merge 3 commits intomainfrom
Usr/sogh/deprecate-disabled-flags
Open

fix: deprecate --*.disabled CLI flags, wire up --mcp.disabled#3482
souvikghosh04 wants to merge 3 commits intomainfrom
Usr/sogh/deprecate-disabled-flags

Conversation

@souvikghosh04
Copy link
Copy Markdown
Contributor

@souvikghosh04 souvikghosh04 commented Apr 29, 2026

Why make this change?

dab init has both --rest.disabled and --rest.enabled (same for graphql/mcp) for the same property. This is confusing UX. Additionally, --mcp.disabled was defined but never wired up (no-op).

What is this change?

  • Hide --rest.disabled, --graphql.disabled, --mcp.disabled from --help output (Hidden = true)
  • Add [Deprecated] prefix to HelpText for all three flags
  • Add deprecation warning for --mcp.disabled (was missing — REST and GraphQL already had them)
  • Wire up --mcp.disabled through TryDetermineIfApiIsEnabled (was previously a no-op)
  • Remove unused TryDetermineIfMcpIsEnabled helper
  • Fix REST+GraphQL disabled-together check to use resolved enabled booleans instead of raw Disabled flags

Breaking change analysis

  • Non-breaking: All --*.disabled flags still work — they are just hidden from --help
  • Behavior fix for MCP: --mcp.disabled was previously a no-op; now it actually disables MCP
  • Existing scripts: Will continue working; deprecation warnings appear in logs

How was this tested?

  • Unit tests
  • Integration tests

Sample Request(s)

NA

- Hide --rest.disabled, --graphql.disabled, --mcp.disabled from --help (Hidden=true)
- Add [Deprecated] prefix to HelpText for all three flags
- Add missing deprecation warning for --mcp.disabled
- Wire --mcp.disabled through TryDetermineIfApiIsEnabled (was previously a no-op)
- Remove unused TryDetermineIfMcpIsEnabled helper
- Use resolved enabled booleans for REST+GraphQL disabled-together check
- Add 5 MCP test rows to TestEnabledDisabledFlagsForApis
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves dab init CLI UX by deprecating the --*.disabled flags (while keeping them functional), wiring up the previously no-op --mcp.disabled, and expanding tests to cover MCP enabled/disabled combinations.

Changes:

  • Hide --rest.disabled, --graphql.disabled, --mcp.disabled from help output and mark them as deprecated via HelpText + warnings.
  • Wire --mcp.disabled through the shared enabled/disabled resolution logic and remove the MCP-specific helper.
  • Extend end-to-end CLI tests to validate MCP enabled/disabled flag behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/Cli/ConfigGenerator.cs Adds MCP deprecation warning, wires --mcp.disabled into the common resolver, and adjusts REST+GraphQL disabled validation logic.
src/Cli/Commands/InitOptions.cs Hides deprecated --*.disabled flags from --help and prefixes HelpText with [Deprecated].
src/Cli.Tests/EndToEndTests.cs Adds MCP cases to enabled/disabled flag matrix and asserts MCP runtime config values.
Comments suppressed due to low confidence (1)

src/Cli/ConfigGenerator.cs:250

  • The init-time validation currently fails when both REST and GraphQL are disabled, even if MCP is enabled. This is stricter than runtime validation (RuntimeConfigValidator.ValidateGlobalEndpointRouteConfig only rejects the config when REST+GraphQL+MCP are all disabled), and it prevents generating an MCP-only config via dab init --rest.enabled false --graphql.enabled false.

Consider updating this check to only error when all three endpoints are disabled (and update the error message accordingly).

            if (!restEnabled && !graphQLEnabled)
            {
                _logger.LogError("Both Rest and GraphQL cannot be disabled together.");
                return false;
            }

Comment thread src/Cli/ConfigGenerator.cs
Comment thread src/Cli.Tests/EndToEndTests.cs Outdated
@souvikghosh04 souvikghosh04 marked this pull request as ready for review May 7, 2026 10:50
@souvikghosh04 souvikghosh04 moved this from In Progress to Review In Progress in Data API builder May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Review In Progress

Development

Successfully merging this pull request may close these issues.

[not-quite-a-bug]: invalid disabled

4 participants